// 文章相关的操作, 全封装在这里
import request from '@/utils/request'

/**
 * 获取频道文章列表
 * @param {*} id 频道 id
 * @param {*} timestamp 时间戳
 */
export const reqGetArticles = (id, timestamp) => {
  return request({
    method: 'get',
    url: '/v1_0/articles',
    params: {
      channel_id: id,
      timestamp
    }
  })
}

/**
 * 标记不喜欢
 * @param {*} articleId 文章 id
 */
export const reqDisLikeArticle = (articleId) => {
  return request({
    method: 'post',
    url: '/v1_0/article/dislikes',
    data: {
      target: articleId
    }
  })
}

/**
 * 举报文章
 * @param {*} articleId 文章 id
 * @param {*} type 举报类型编号
 */
export const reqReportArticle = (articleId, type) => {
  return request({
    method: 'post',
    url: '/v1_0/article/reports',
    data: {
      target: articleId,
      type
    }
  })
}
